<?php
/*******************************************************************************
 *
 *  Name: irtIncidentSelect
 *
 *  Date: 5/03/2012
 *  
 *  Description: View that shows a simple select for the incident repair
 *               crew to choose an incident to select. If there are no
 *               incidents assigned to them, then they can go no further
 *  
 *  Author:     David Jarman
 *  
 *  Todo:
 *     NONE
 *
 *  Modification History:  
 * 
 *   Date         Name
 *  ----------   --------------
 *  2012-04-26   DAVID JARMAN
 *  2012-04-26   DAVID JARMAN
 *  2012-04-25   DAVID JARMAN
 *  2012-04-24   DAVID JARMAN
 *  2012-05-03   DAVID JARMAN
 * 
 *****************************************************************************/
?>

<html>
	<head>
		
	</head>

	<body>
		<div style="text-align:center" id="IncidentSelectSection">
			<form name="IncidentForm" action="" method="post">
				<p>Please Select an Incident</p>
				<select name="IncidentID">
					<?php
						if(count($options) > 0)
                        {
                            //loop through each option and display it
						    foreach( $options as $incident )
						    {
                        		echo "<option value='".$incident['IncidentID'] ."' ";
                        		if( $this->input->post('IncidentID', TRUE) == $incident['IncidentID'] )
                           		    echo "selected='selected'";
                        		echo " >".$incident['IncidentID'] . ' - ' . $incident['Name']."</option>";
						    }
                        }
                        else
                        {
                            echo "<option value='none'>No Incidents Assigned</option>";
                        }
					?>
				</select>
                <br>
                    <div style="text-align:center">
				        <p><input name="IncidentSelectSubmit" type="submit" value="Select" <?php 
                            if(count($options) == 0) echo "disabled='disabled'"; ?> /><p>
                    </div>
			</form>
		</div>
	</body>
</html>
